/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author GiangLT
 */
@Embeddable
public class KetResultPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 4)
    @Column(name = "MA_TINH")
    private String maTinh;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "CAU_NUMBER")
    private String cauNumber;

    public KetResultPK() {
    }

    public KetResultPK(String maTinh, String cauNumber) {
        this.maTinh = maTinh;
        this.cauNumber = cauNumber;
    }

    public String getMaTinh() {
        return maTinh;
    }

    public void setMaTinh(String maTinh) {
        this.maTinh = maTinh;
    }

    public String getCauNumber() {
        return cauNumber;
    }

    public void setCauNumber(String cauNumber) {
        this.cauNumber = cauNumber;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (maTinh != null ? maTinh.hashCode() : 0);
        hash += (cauNumber != null ? cauNumber.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof KetResultPK)) {
            return false;
        }
        KetResultPK other = (KetResultPK) object;
        if ((this.maTinh == null && other.maTinh != null) || (this.maTinh != null && !this.maTinh.equals(other.maTinh))) {
            return false;
        }
        if ((this.cauNumber == null && other.cauNumber != null) || (this.cauNumber != null && !this.cauNumber.equals(other.cauNumber))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.KetResultPK[ maTinh=" + maTinh + ", cauNumber=" + cauNumber + " ]";
    }
    
}
